package cn.com.gridinfo.sooc.utils.versionHttp;

import android.os.AsyncTask;

/**
 * 异步任务工具
 */
public class AsyncTaskUtil extends AsyncTask<Object, Integer, String> {
    public static AsyncTask<Object, Integer, String> getAsyncTaskUtil(AsyncCallback callback) {
        return new AsyncTaskUtil(callback);
    }

    private AsyncCallback callback;

    public AsyncTaskUtil(AsyncCallback callback) {

        this.callback = callback;
    }

    @Override
    protected String doInBackground(Object... params) {
        return callback.doInBackground(params);
    }

//	@Override
//	protected void onCancelled() {
//		super.onCancelled();
//		callback.Cancelled();
//	}

    @Override
    protected void onPostExecute(String result) {
        callback.PostExecute(result);
    }

    @Override
    protected void onPreExecute() {
        callback.PreExecute();
    }

    @Override
    protected void onProgressUpdate(Integer... values) {
        callback.ProgressUpdate(values);
    }

}
